package com.ruoyi.odorservice.mapper;

import com.ruoyi.odorservice.entity.HandleSample;
import com.ruoyi.odorservice.model.bean.SiteMaterialConcentrationBean;
import com.ruoyi.odorservice.model.bean.CorrelationAnalysisBean;
import com.ruoyi.odorservice.model.vo.ConcentrationContributionVo;
import com.ruoyi.odorservice.model.vo.MaterialTotalTrendVo;
import com.ruoyi.odorservice.model.vo.OdorActivityAnalysisVo;
import com.ruoyi.odorservice.model.vo.OdorProfileVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;

@Mapper
public interface AnalysisMapper {
    /**
     * 总量趋势分析
     * @param startTime
     * @param endTime
     * @param siteName
     * @return
     */
    List<MaterialTotalTrendVo> getTotalTrend(@Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime, @Param("siteName")String siteName);

    /**
     * 气味活度分析
     * @param startTime
     * @param endTime
     * @param siteName
     * @return
     */
    List<OdorActivityAnalysisVo> getOdorActivity(@Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime, @Param("siteName")String siteName);

    /**
     * 相关性分析-获取气味词及强度值集合
     * @param startTime
     * @param endTime
     * @param siteName
     * @return
     */
    List<CorrelationAnalysisBean> getOdorIntensity(@Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime, @Param("siteName")String siteName);

    /**
     * 相关性分析-获取物质名称及物质浓度
     * @param startTime
     * @param endTime
     * @param siteName
     * @return
     */
    List<CorrelationAnalysisBean> getMaterialConcentration(@Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime, @Param("siteName")String siteName);

    /**
     * 获取致臭物质指定页
     * @param offset
     * @param limit
     * @param startTime
     * @param endTime
     * @param siteName
     * @return
     */
    List<HandleSample> getOdorousMaterialList(@Param("offset") Integer offset, @Param("limit") Integer limit, @Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime, @Param("siteName")String siteName);

    /**
     * 获取致臭物质总数
     * @param startTime
     * @param endTime
     * @param siteName
     * @return
     */
    Integer getOdorousMaterialNum(@Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime, @Param("siteName")String siteName);

    List<ConcentrationContributionVo.SimpleMaterial> concentrationContributions(@Param("offset") Integer offset, @Param("limit") Integer limit, @Param("start") LocalDateTime start, @Param("end") LocalDateTime end, @Param("siteName") String siteName);

    Integer concentrationContributionsTotal(@Param("start") LocalDateTime start,@Param("end") LocalDateTime end,@Param("siteName") String siteName);

    List<OdorProfileVo> odorProfile(@Param("start")LocalDateTime start,@Param("end") LocalDateTime end);

    /**
     * 获取所有点位所有采样记录中每个物质的浓度
     * @param startTime
     * @param endTime
     * @return
     */
    List<SiteMaterialConcentrationBean> clusterAnalysis(@Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime);
}
